package practice01;

public class practice02 {
    public static void main(String[] args) {
        Cat c01=new Cat();
        Dog d01=new Dog();
        Animal a01=new Animal();
        Animal c02=new Cat();
        Animal d02=new Dog();
//        c01.eat();
//        d01.eat();
//        c01.jump();
//        d01.run();
//        a01.eat();
//        c02.eat();
//        d02.eat();
//        a01.play();
//        c01.play();
//        c02.play();
//        d01.play();
//        d02.play();
            c01.printName();
            d01.printName();
            a01.printName();
            c02.printName();
            d02.printName();

    }
}
class  Animal{
    String name="小动物";
    String kind;

    public void printName(){
        System.out.println("动物"+name);
    }
    public void eat(){
        System.out.println("小动物吃啥都行");
    }
    public static void play(){
        System.out.println("小动物都爱玩");
    }
}
class Cat extends Animal{
    String name;
    public void printName(){
        System.out.println("小猫"+super.name);
    }
    @Override
    public void eat(){
        System.out.println("小猫爱吃鱼");
    }
    public void jump(){
        System.out.println("小猫爱跳");
    }
    public static void play(){
        System.out.println("小猫爱玩");
    }
}
class Dog extends Animal{
    String name;
    public void printName(){
        System.out.println("小狗"+super.name);
    }
    @Override
    public void eat(){
        System.out.println("小狗爱吃肉");
    }
    public void run(){
        System.out.println("小狗爱跑");
    }
    public static void play(){
        System.out.println("小狗爱玩");
    }
}